package domain.entities;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * CentroAddressId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class CentroAddressId implements java.io.Serializable {

	// Fields

	private Integer addressid;
	private Integer centroid;

	// Constructors

	/** default constructor */
	public CentroAddressId() {
	}

	/** full constructor */
	public CentroAddressId(Integer addressid, Integer centroid) {
		this.addressid = addressid;
		this.centroid = centroid;
	}

	// Property accessors

	@Column(name = "Addressid", nullable = false)
	public Integer getAddressid() {
		return this.addressid;
	}

	public void setAddressid(Integer addressid) {
		this.addressid = addressid;
	}

	@Column(name = "CENTROid", nullable = false)
	public Integer getCentroid() {
		return this.centroid;
	}

	public void setCentroid(Integer centroid) {
		this.centroid = centroid;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof CentroAddressId))
			return false;
		CentroAddressId castOther = (CentroAddressId) other;

		return ((this.getAddressid() == castOther.getAddressid()) || (this
				.getAddressid() != null
				&& castOther.getAddressid() != null && this.getAddressid()
				.equals(castOther.getAddressid())))
				&& ((this.getCentroid() == castOther.getCentroid()) || (this
						.getCentroid() != null
						&& castOther.getCentroid() != null && this
						.getCentroid().equals(castOther.getCentroid())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getAddressid() == null ? 0 : this.getAddressid().hashCode());
		result = 37 * result
				+ (getCentroid() == null ? 0 : this.getCentroid().hashCode());
		return result;
	}

}